import request from '@/utils/request'

// 退货原因列表
export const fetchReturnReasonList = (params) => {
    return request({
        url: '/returnReason/list',
        method: 'get',
        params: params
    })
}

// 删除退货原因
export const deleteReason = (params) => {
    return request({
        url: '/returnReason/delete',
        method: 'post',
        params: params
    })
}

// 更新退货原因状态
export const updateReasonStatus = (params) => {
    return request({
        url: '/returnReason/update/status',
        method: 'post',
        params: params
    })
}

// 添加退货原因
export const addReason = (data) => {
    return request({
        url: '/returnReason/create',
        method: 'post',
        data: data
    })
}

// 获取退货原因详情
export const getReasonDetail = (id) => {
    return request({
        url: '/returnReason/' + id,
        method: 'get'
    })
}

// 更新退货原因
export const updateReason = (id, data) => {
    return request({
        url: '/returnReason/update/' + id,
        method: 'post',
        data: data
    })
}
